﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

/// <summary>
/// Summary description for IFriends
/// </summary>
public interface IFriends
{
    /// <summary>
    /// Get list object Friends of user
    /// </summary>
    /// <param name="username">Object Users</param>
    /// <returns>Return list object Friends</returns>
    List<Friends> GetFriendOfUser(Users user);

    /// <summary>
    /// Check User is friend. 
    /// </summary>
    /// <param name="mine">This is mine</param>
    /// <param name="myFriend">This is my friend</param>
    /// <returns>Return result relation of two User. If relation is friend then return 1, else return 0</returns>
    bool IsFriend(Users mine, Users myFriend);

    /// <summary>
    /// Insert friend for user
    /// </summary>
    /// <param name="mine">This is mine</param>
    /// <param name="myFriend">This is my friend</param>
    /// <returns>Return result was created</returns>
    bool InsertFriend(Users mine, Users myFriend);

    /// <summary>
    /// Update friend's active
    /// </summary>
    /// <param name="friend">Object Friends of user</param>
    /// <returns>Return result was updated. If success then return 1, else return 0</returns>
    bool UpdateActiveFriend(Friends friend);

    /// <summary>
    /// Delete friend
    /// </summary>
    /// <param name="friend">Object Friend want to delete</param>
    /// <returns>Return result was deleted. If deleted then return 1, else return 0</returns>
    bool DeleteFriendByUsername(Friends friend);
    
    /// <summary>
    /// Convert object DataRow to object Friends
    /// </summary>
    /// <param name="dr">Object DataRow from DataTable</param>
    /// <returns>Return object Friends was converted</returns>
    Friends ConvertObjectDataRowToFriends(DataRow dr);
}